<form nz-form [formGroup]="validateForm" nzLayout="horizontal">
    <nz-form-item>
        <nz-form-label [nzSpan]="6" nzFor="roleName">角色名称</nz-form-label>
        <nz-form-control [nzSpan]="16" nzErrorTip="请输入角色名称！">
            <input nz-input name="roleName" formControlName="roleName" readonly placeholder="请输入角色名称" />
        </nz-form-control>
    </nz-form-item>
    <nz-form-item>
        <nz-form-label [nzSpan]="6" nzFor="roleKey" nzTooltipTitle="控制器中定义的权限字符，如：@PreAuthorize(`@ss.hasRole('admin')`)">
            <span>权限字符</span>
        </nz-form-label>
        <nz-form-control [nzSpan]="16" nzErrorTip="请输入权限字符！">
            <input nz-input id="roleKey" formControlName="roleKey" readonly placeholder="请输入权限字符" />
        </nz-form-control>
    </nz-form-item>
    <nz-form-item>
        <nz-form-label [nzSpan]="6" nzFor="dataScope">权限范围</nz-form-label>
        <nz-form-control [nzSpan]="16">
            <nz-select name="dataScope" formControlName="dataScope">
                <nz-option *ngFor="let item of dataScopeOptions" [nzValue]="item.value" [nzLabel]="item.label" />
            </nz-select>
        </nz-form-control>
    </nz-form-item>
    <ng-container *ngIf="showDeptTree">
        <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="deptIds">数据权限</nz-form-label>
            <nz-form-control [nzSpan]="16">
                <div style="padding: 4px 0px 8px 0px">
                    <label nz-checkbox formControlName="deptNodeAll">全选/全不选</label>
                    <label nz-checkbox formControlName="deptCheckStrictly">父子联动</label>
                </div>
                <nz-tree
                    #nzTreeComponent
                    [nzData]="nodes"
                    nzCheckable
                    [nzCheckedKeys]="defaultCheckedKeys"
                    [nzCheckStrictly]="!defaultCheckStrictly"
                    (nzCheckBoxChange)="nzCheck($event)"
                    (nzExpandChange)="nzCheck($event)"
                    nzVirtualHeight="300px"
                />
            </nz-form-control>
        </nz-form-item>
    </ng-container>
</form>
<div class="modal-footer">
    <button nz-button type="submit" [nzType]="'primary'" (click)="submitForm()" [nzLoading]="loading"> 提交 </button>
    <button nz-button type="button" (click)="modalRef.destroy()">取消</button>
</div>
